//
//  HD_LY_NetHelper.h
//  HDNetworkManagerDemo
//
//  Created by liuyi on 2017/5/15.
//  Copyright © 2017年 liuyi. All rights reserved.
//

/*
 版本：V1.1
 开发者：刘毅
 更新时间：2017-05-23
 功能描述：网络请求封装（封装添加请求加载动画和网络数据缓存模块）
 
 */

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

typedef enum{
    StatusUnknown           = -1, //未知网络
    StatusNotReachable      = 0,    //没有网络
    StatusReachableViaWWAN  = 1,    //手机自带网络
    StatusReachableViaWiFi  = 2     //wifi
    
} NetStatus;//网络状态

typedef enum HttpMethod {
    GET,
    POST
} httpMethod;//请求方式

typedef void(^ ResponseSuccess)(id response);//请求成功回调
typedef void(^ ResponseFail)(NSError *error);//请求失败回调

@interface HD_LY_NetHelper : NSObject

@property (nonatomic, assign) NetStatus networkStats;
//网络请求
+ (void)requestWithType:(httpMethod)httpMethod
                withUrl:(NSString *)url
             withParams:(NSDictionary *)params
               toShowVC:(UIViewController *)showVC
                success:(ResponseSuccess)success
                   fail:(ResponseFail)fail
                showHUD:(BOOL)show
                isCache:(BOOL)cache;

//图片上传
+ (void)uploadImgwithUrl:(NSString *)url
              withParams:(NSDictionary *)params
                toShowVC:(UIViewController *)showVC
                 keyName:(NSString *)name
                 imgData:(UIImage *)img
                 success:(ResponseSuccess)success
                    fail:(ResponseFail)fail;



@end














